A library for incrementaly build config objects through layering config files in many formats.
Check out the features:
- Support native objects input directly
- Load config files
- Merge configs chronologically
- Option to watch changes in loaded config files
- Supported formats so far: TOML (
toml
), JSON, CSON (cson-parser
) and YAML (yaml
)
Get Started
Install with: npm i -P confort
You also need to install the lib for parsing the type of file you mean to use like: npm i toml
for parsing TOML
In your code:
const Confort = require('confort');
let conf = new Confort();
let conf = new Confort({ key: 'value', key2: 'value2' });
let conf = new Confort('./my-file.toml');
conf.addLayer({ key: 'value' });
conf.object;
conf.addLayer({ key: 'newValue', otherKey: 'value' });
conf.object;
conf.addLayer('./my-file.yml');
conf.clear();
conf.reload();
conf.liveReload = true;
conf.liveReload = false;
Reporting Bugs
If you have found any problems with this module, please:
- Open an issue.
- Describe what happened and how.
- Also in the issue text, reference the label
~bug
.
We will make sure to take a look when time allows us.
Proposing Features
If you wish to get that awesome feature or have some advice for us, please:
- Open an issue.
- Describe your ideas.
- Also in the issue text, reference the label
~proposal
.
Contributing
If you have spotted any enhancements to be made and is willing to get your hands
dirty about it, fork us and
submit your merge request
so we can collaborate effectively.